#pragma once


namespace SHGame {
	using namespace System;
	using namespace System::Collections::Generic;

	/*
	This is a ref class to offer static methods for a "turn-based" game
	*/
	public ref class TurnPlay
	{
	public:
		/*
		The event property fired when there is a new player starting his turn
		*/
		static String^ TurnNextEvent = "turn.next";
		/*
		The event fired when the last player takes his turn
		*/
		static String^ TurnEndEvent = "turn.end";
		/*
		The event fired when the first play starts his turn
		*/
		static String^ TurnStartEvent = "turn.start";
		static TurnPlay^ Instance = gcnew TurnPlay();
	private:
		static array<Player^> ^parr = gcnew array<Player^>(5);
		static int turn = -1;
		static int start = 0;
		static PropChangeSupport^ pcs = gcnew PropChangeSupport(Instance);



	public:
		static Player^ GetPlayerAt(int);
		static void SetPlayerAt(int, Player^);
		static Player^ GetHuman();
		static bool IsHumanTurn();
		static void Start();
		static void SetStart(Player^);
		static bool ReadyForStart();

		static property Player^ Current;
		static bool MoveNext();
		static int GetIndexOf(Player^);
		static void Stop();

		static array<Player^>^ GetRest();

	private:
		TurnPlay(void);
	};
}
